Skip to content

Remove the interpolation buffer#53

Merged
kahrendt merged 3 commits into
mainfrom
remove-interpolation-buffer
May 12, 2026
Merged

Remove the interpolation buffer#53
kahrendt merged 3 commits into
mainfrom
remove-interpolation-buffer

Conversation

@kahrendt
Copy link
Copy Markdown
Contributor

@kahrendt kahrendt commented May 12, 2026

  • Soft sync is done in the decoded output transfer buffer
  • A small 1 KB null buffer is always allocated (much less than teh prior approach) in internal memory. This avoids flash/psram contention at the start of a stream when stuttering is most common
  • Removes one large heap allocation overall

- Soft sync is done in the output transfer buffer
- A small 1 KB null buffer is always allocated (much less than teh prior approach) in internal memory. This avoids flash/psram contention at the start of a stream when stuttering is most common
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the dedicated interpolation transfer buffer and shifts both soft-sync frame insertion and hard-sync/initial-sync silence emission to operate without an extra heap-allocated buffer (using the decode transfer buffer’s spare-frame reservation for soft sync, and a fixed zero scratch buffer for silence writes). This reduces memory use and avoids flash/PSRAM contention during stream start on ESP32-class targets.

Changes:

  • Removed interpolation_transfer_buffer and its config knob; soft-sync insertion now uses a reserved spare frame inside decode_buffer.
  • Added silence_remaining + send_pending_silence() to stream silence directly to the sink using a fixed 1KB zero scratch buffer.
  • Updated docs to reflect the new soft-sync insertion position and the config/API change.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/sync_task.h Removes interpolation buffer field; adds silence tracking and updates comments for new soft-sync strategy.
src/sync_task.cpp Implements silence streaming via scratch buffer; moves soft-sync insertion to decode buffer spare frame; removes interpolation buffer allocation/usage.
include/sendspin/config.h Removes interpolation_buffer_location from PlayerRoleConfig.
docs/internals.md Updates soft-sync description to match “near end” insertion behavior.
docs/integration-guide.md Updates configuration documentation to remove interpolation buffer option and clarify decode_buffer_location.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/sync_task.cpp
Comment thread src/sync_task.cpp
Comment thread src/sync_task.cpp
@kahrendt kahrendt enabled auto-merge (squash) May 12, 2026 13:27
@kahrendt kahrendt merged commit d26833b into main May 12, 2026
4 checks passed
@kahrendt kahrendt deleted the remove-interpolation-buffer branch May 12, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants